<template>
  <el-container>
    <el-main>
      <el-row>
        <el-col :span="6">联系人</el-col>
        <el-col :span="18">
          <el-input></el-input>
        </el-col>
      </el-row>
      <el-divider></el-divider>
      <el-row>
        <el-col :span="5" :offset="6">
          <el-button size="mini">&nbsp;&nbsp;&nbsp;男&nbsp;&nbsp;&nbsp;</el-button>
        </el-col>
        <el-col :span="5">
          <el-button size="mini">&nbsp;&nbsp;&nbsp;女&nbsp;&nbsp;&nbsp;</el-button>
        </el-col>
      </el-row>
      <el-divider></el-divider>
      <el-row>
        <el-col :span="6">电话</el-col>
        <el-col :span="18">
          <el-input></el-input>
        </el-col>
      </el-row>
      <el-divider></el-divider>
      <el-row>
        <el-col :span="6">地址</el-col>
        <el-col :span="18">
          <el-input></el-input>
        </el-col>
      </el-row>
      <el-divider></el-divider>
      <el-row>
        <el-col :span="6">门牌号</el-col>
        <el-col :span="18">
          <el-input></el-input>
        </el-col>
      </el-row>
      <el-divider></el-divider>
      <el-row>
        <el-col :span="6">标签</el-col>

        <el-col :span="5">
          <el-button size="mini">&nbsp;&nbsp;&nbsp;家&nbsp;&nbsp;&nbsp;</el-button>
        </el-col>
        <el-col :span="5">
          <el-button size="mini">&nbsp;&nbsp;学校&nbsp;&nbsp;</el-button>
        </el-col>
        <el-col :span="5">
          <el-button size="mini">&nbsp;&nbsp;公司&nbsp;&nbsp;</el-button>
        </el-col>
      </el-row>

      <el-divider></el-divider>
      <el-button @click="saveInformation">保存并使用</el-button>

    </el-main>
  </el-container>
</template>

<script>
    export default {
        name: "AddressInsert",
        data() {
            return {
                addressAll: [],
            }
        },
        methods: {
            saveInformation() {
                let address = {};
                address['id'] = 1;
                address['name'] = '地址名称';
                address['detail'] = '门牌号';
                address['username'] = '姓';
                address['sex'] = 1;
                address['phone'] = 13111111111;
                address['tag'] = 1;
                this.addressAll = JSON.parse(this.$ls.get('address')) || [];
                this.addressAll.push(address);
                this.$ls.set('address', JSON.stringify(this.addressAll));
                this.$router.go(-1);
            }
        }
    }
</script>

<style scoped>
  .el-divider {
    margin: 10px 0;
  }
</style>
